package com.t11.consumer.controller;

import com.t11.common.pojo.LzwGoods;
import com.t11.common.service.GoodsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 商品接口
 */
@RestController
public class GoodsController {


    @Resource
    GoodsService goodsService;


    /**
     * 详情页接口
     * @param goodsId 商品ID
     * @return 查询到的商品信息
     */
    @GetMapping("details/{goodsId}")
    public LzwGoods toDetails(@PathVariable String goodsId) {
        return goodsService.findGoodsById(goodsId);
    }
}
